package autoteam.ui.tabs;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;

import autoteam.League;

public class TeamsTab extends JTabbedPane
{
	private static final long serialVersionUID = -3342451689549671939L;

	public League doc;

	private JFrame owner;

	public TeamsTab(JFrame parentFrame) // for testing purposes only
	{
		super();
		owner = parentFrame;
		createTabs();
	}

	public TeamsTab(League _doc, JFrame parentFrame)
	{
		super();
		doc = _doc;
		owner = parentFrame;
		createTabs(_doc);
	}

	private void createTabs()
	{
		this.add( "Manage Teams", new ManageTeamsTab( owner ));
		// this.add( "Assign Sibling", new AssignSiblingsTab( owner ));
		// this.add( "Assign Carpools", new AssignCarpoolsTab( owner ));
		

		this.setSelectedIndex(0);
		this.setOpaque(true);
	}

	private void createTabs(League _doc)
	{
		// Here are the tabs: Each one is its own JPanel
		this.add( "Manage Teams", new ManageTeamsTab( _doc, owner ));
		this.add( "Assign Sibling", new AssignSiblingsTab( _doc, owner ));
		this.add( "Assign Carpools", new AssignCarpoolsTab( _doc, owner ));
		this.setSelectedIndex(0);
		this.setOpaque(true);
	}
}
